package edu.bbu.commonproject.desktop.client.factory;

import edu.bbu.commonproject.desktop.client.factory.thrift.ThriftCLTFactory;
import edu.bbu.commonproject.desktop.client.services.DirectoryCLTServices;
import edu.bbu.commonproject.desktop.client.services.FileCLTServices;
import edu.bbu.commonproject.desktop.client.services.UserCLTServices;

/**
 * The client factory.
 */
public abstract class CLTFactory
{
	/** The thrift factory type. */
	public static final int THRIFT_FACTORY = 1;
	
	/** Getting the client user services, which should be implemented in concrete factories. */
	public abstract UserCLTServices getUserCLTServices();
	
	/** Getting the client file services, which should be implemented in concrete factories. */
	public abstract FileCLTServices getFileCLTServices();
	
	/** Getting the client directory services, which should be implemented in concrete factories. */
	public abstract DirectoryCLTServices getDirectoryCLTServices();
	
	/**
	 * Getting a concrete factory.
	 * @param factoryType - the concrete factory type.The factory types are defined as static fields of CLTFactory.
	 * @return new copy of the specified factory or null if the factory does not exists.
	 */
	public static CLTFactory getCLTFactory(int factoryType)
	{
		switch (factoryType)
		{
			case THRIFT_FACTORY:
			{
				return new ThriftCLTFactory();
			}
		}
		
		return null;
	}
}
